package com.wcll.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.wcll.bean.*;

import java.util.*;
public class CQM_JianLiServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
	throws ServletException, IOException {
		
		
		
		
	}
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		  response.setContentType("text/html; charset=UTF-8");
			request.setCharacterEncoding("UTF-8");
		CQM_JianLi jianli=new CQM_JianLi();
		
	    List li=new ArrayList();
		
		String name=request.getParameter("name");
		String sex=request.getParameter("sex");
	    String email=request.getParameter("email");
		String phone=request.getParameter("phone");
	    String zhuzhi=request.getParameter("zhuzhi");
	    String sheng=request.getParameter("sheng");
	    String shi=request.getParameter("shi");
	    String xian=request.getParameter("xian");
	    String gongzi=request.getParameter("gongzi");
	    String desc=request.getParameter("desc");
	    String xuexiaoname=request.getParameter("xuexiaoname");
	    String zhuanyename=request.getParameter("zhuanyename");
	    String xueli=request.getParameter("xueli");
	    String waiyu=request.getParameter("waiyu");
	    String nengli=request.getParameter("nengli");
	    String jiangxiang=request.getParameter("jiangxiang");
	    String desc1=request.getParameter("desc1");
	    String shijianname=request.getParameter("shijianname");
	    String desc2=request.getParameter("desc2");
	    request.getSession().setAttribute("name", name);
	    request.getSession().setAttribute("sex", sex);
	    request.getSession().setAttribute("email", email);
	    request.getSession().setAttribute("phone", phone);
	    request.getSession().setAttribute("zhuzhi", zhuzhi);
	  
	    request.getSession().setAttribute("a", sheng);
	    request.getSession().setAttribute("b", shi);
	    request.getSession().setAttribute("c", xian);
	    
	    jianli.setName(name);
	    jianli.setEmail(email);
	    jianli.setPhone(phone);
	    jianli.setSex(sex);
	    jianli.setZhuzhi(zhuzhi);
	    jianli.setSheng(sheng);
	    jianli.setShi(shi);
	    jianli.setXian(xian);
	    jianli.setGongzi(gongzi);
	    jianli.setDesc(desc);
	    jianli.setXuexiaoname(xuexiaoname);
	    jianli.setZhuanyename(zhuanyename);
	    jianli.setXueli(xueli);
	    jianli.setWaiyu(waiyu);
	    jianli.setNengli(nengli);
	    jianli.setJiangxiang(jiangxiang);
	    jianli.setDesc1(desc1);
	    jianli.setShijianname(shijianname);
	    jianli.setDesc2(desc2);
	    li.add(jianli);
	    String user=(String)request.getSession().getAttribute("loginname");
	    
	    request.getSession().setAttribute("user1", request.getParameter("name"));
	     String hidden =request.getParameter("hidden");
	     request.getSession().setAttribute("cishu", hidden);
	    
	    
	    
	   
	try {
		jianli.jianLi(jianli,user,hidden);
		this.getServletContext().getRequestDispatcher("/cqm_yiXiang.jsp")
		.forward(request, response);
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (ClassNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
		
	}

	
}
